package com.itcat.controller;

import com.itcat.common.CommonPage;
import com.itcat.common.CommonResult;
import com.itcat.mysql.param.OmsOrderParam;
import com.itcat.mysql.pojo.OmsOrder;
import com.itcat.mysql.pojo.OmsOrderSetting;
import com.itcat.service.OmsOrderSettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/orderSetting")
public class OmsOrderSettingController {

    @Autowired
    private OmsOrderSettingService omsOrderSettingService;


    /**
     * 查询订单设置
     *
     * @return
     */
    @GetMapping("/{id}")
    public CommonResult OrderSetting(@PathVariable Integer id) {
        OmsOrderSetting omsOrderSetting = omsOrderSettingService.findSetting(id);
        return CommonResult.success(omsOrderSetting);
    }

    /**
     * 修改订单设置
     *
     * @return
     */
    @PostMapping("/update/{id}")
    public CommonResult UpdateOrderSetting( @RequestBody OmsOrderSetting omsOrderSetting) {
        omsOrderSettingService.updateSetting(omsOrderSetting);
        return CommonResult.success(null);
    }


}
